/**
 * @author Justin Akin
 * @version Action Pals Core Library 0.1.0
 */
package com.actionpals.components.controls
{
	import com.actionpals.components.containers.Box;
	import com.actionpals.components.containers.ScrollableContainer;
	
	import flash.display.DisplayObject;
	import flash.geom.Rectangle;
	
	/**
	 * 
	 */
	public class ScrollableMenu extends ScrollableContainer
	{		
		
	//--------------------------------------------------------------------------------
	//
	//	Protected Member Variables
	//
	//--------------------------------------------------------------------------------
	
		protected var box:Box;
				
	//--------------------------------------------------------------------------------
	//
	//	Constructor
	//
	//--------------------------------------------------------------------------------
		
		/**
		 * Constructor
		 */	
		public function ScrollableMenu( displayBounds:Rectangle )
		{
			super( displayBounds );
		}
		
	//--------------------------------------------------------------------------------
	//
	//	Public Methods
	//
	//--------------------------------------------------------------------------------
		
		public override function addChild( child:DisplayObject ):DisplayObject
		{			
			return box.addChild( child );
		}
		
		public override function addChildAt( child:DisplayObject, index:int ):DisplayObject
		{			
			return box.addChildAt( child, index );
		}
		
		public override function removeChild( child:DisplayObject ):DisplayObject
		{			
			return box.removeChild( child );
		}
		
		public override function removeChildAt( index:int ):DisplayObject
		{			
			return box.removeChildAt( index );
		}
		
	//--------------------------------------------------------------------------------
	//
	//	Getters and Setters
	//
	//--------------------------------------------------------------------------------
		
		public function get boxDirection():String
		{
			return box.direction;
		}
		
		public function set boxDirection( value:String ):void
		{
			box.direction = value
		}
		
		public function get boxMargin():Number
		{
			return box.margin;
		}
		
		public function set boxMargin( value:Number ):void
		{
			box.margin = value;
		}
		
		public function get boxAutoArrange():Boolean
		{
			return box.autoArrange;
		}
		
		public function set boxAutoArrange( value:Boolean ):void
		{
			box.autoArrange = value;
		}
		
	//--------------------------------------------------------------------------------
	//
	//	Protected Methods
	//
	//--------------------------------------------------------------------------------
		
		protected override function addDisplay():void
		{
			_display = addChild( new Box() ) as Box;
			box = _display as Box;			
		}
		
	}
	
}